package com.kim.nidoya.activity;


import android.content.Intent;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;

import com.kim.nidoya.R;
import com.kim.nidoya.utils.ActivityDispatchUtil;

public class Test_03 extends BaseActivity {
	TextView test;
	Button button;

	@Override
	protected void initParam() {
		setContentView(R.layout.test);
		test = (TextView) findViewById(R.id.test_txv);
		test.setText("这个是activity 03");
		button = (Button) findViewById(R.id.test_btn);
		button.setText("关闭当前activity");
		button.setOnClickListener(this);
	}

	@Override
	protected void initView() {

	}

	@Override
	public void onClick(View v) {
		int vid = v.getId();
		switch (vid) {
		case R.id.test_btn://关闭当前activity
//			//要跳转的Activity  
//            Intent intent = new Intent(this, Test_01.class);  
//            // 把Activity转换成一个Window，然后转换成View  
//            Window w = FirstGroup.group.getLocalActivityManager()  
//                    .startActivity("Test_01",intent);  
//            View view = w.getDecorView();  
//            //设置要跳转的Activity显示为本ActivityGroup的内容  
//            FirstGroup.group.setContentView(view); 
			ActivityDispatchUtil.backToAboveActivity(FirstGroup.group);
			break;

		default:
			break;
		}
	}
}

